package com.sitech.portal.panels.dao.ibatis;

import com.sitech.dao.BaseDao;
import com.sitech.portal.panels.dao.TbCfgPanelSettingDao;
import com.sitech.portal.panels.domain.TbCfgPanelSetting;

import java.util.List;

/**
 * Created by liujhc on 1/3.
 */
public class TbCfgPanelSettingDaoImpl extends BaseDao implements TbCfgPanelSettingDao {
    @Override
    public List<TbCfgPanelSetting> queryPanelSetting(String panelId) {
        return query("queryPanelSetting", panelId);
    }

    @Override
    public void savePanelSettings(List<TbCfgPanelSetting> settings) {
        if (!settings.isEmpty()) {
            this.delete("deletePanelSetting", settings.get(0).getREF());
            this.batchCreate("savePanelSetting", settings);
        }
    }
}
